Prizm Content Connect
PCCIS RESTful Web API

Viewing Sessions

To initiate a view, the following RESTful operations should be performed as detailed in the PCCIS Sample discussion.

POST ViewingSession

The first step for viewing a document is to request a viewing session Identification JSON string. The body of the request is to send useful information about the document to the PCCIS service which helps identify the document that will be uploaded to the service for conversion to a web compatible viewing format. The object to be posted here is the ViewSessionProperties resource which contains several properties.  

The origin property is a key pair dictionary to contain any useful arbitrary data about the document. The PCCIS sample uses ipAddress, hostname and sourceDocument for identification purposes but any arbitrary data can be used which helps identify or characterizes the document.  

The render property is important for storing information for client side rendering. It stores rendering information for both the flash client and HTML client. For flash see the Basic Document Conversion Parameterson enterprise. For HTML5, the new Html5RenderPropertiesclass object has properties to set output dpi resolution and whether raster output should always be used (no SVG format output). 

The externalId property and tenantId should also be set. Typically, the externalId is a unique value which makes it easier to connect items in the server log to that which is in the caller’s log but is not used for any particular purpose and the same goes for tenantId. Please look at the PCCIS sample for more information on using this RESTful API.

Http Method

POST

Resource URL

http://localhost:18681/PCCIS/V1/ViewingSession

Parameters

None

Request Body

In the request body, supply a ViewingSessionProperties resource with the following optional properties:

Property Name

Value

Description

origin

List

A list of key-value pairs containing user-specific data. This is useful for tracking information pertinent to the request, like IP address, Host Name and any other useful bits of information.

render

Nested Object

The object that describes rendering options.

render.flash

Nested Object

The object that describes rendering options for the Flash viewer.

render.flash.optimizationLevel

Integer

Specifies the optimization level used during SWF generation for the Flash viewer:

  • 0 = No compression for text and images.
  • 1 = Text is preserved while everything else is converted to JPEG compressed images.
  • 2 = All content is converted into a single SWF, only links are preserved.

render.html5

Nested Object

The object that describes rendering options for the HTML5 viewer.

render.html5.alwaysUseRaster

Boolean

Forces PCCIS to always provide raster image data to the HTML5 viewer instead of SVG, even if the client supports viewing SVG data.

render.html5.rasterResolution

Integer

Specifies the resolution to use for raster content generated by PCCIS.

password

String

Specifies the password to open password-protected PDF documents.

watermarkText

String

Specifies the text to use for watermarking as supported by the Flash viewer. This property is not currently used for the HTML5 viewer when displaying SVG content.

externalId

String

This is an ID defined by your application. PCCIS will store this value in the current viewing session, but otherwise will not use it directly. It is useful for association in log files and other operations, like annotations.

The PCCIS samples use this ID to store a hash value of the original document name for purposes of creating distinct names for annotation files that are saved by the web tier. See the samples for details.

tenantId

String

This is an ID for a tenant. Tenants are not a formal concept in this system and should be monitored and maintained in the calling system. However, having this data available will allow some optional behavior. For example, with this information, it would be possible to ensure some level of isolation between tenants.

attachmentIndex

Integer

Used for documents with attachment documents, like .MSG and .EML types. Otherwise, this value will typically be 0 for other document types.

attachmentDisplayName

String

Used for documents with attachment documents, like .MSG and .EML types. Provides the display name of the attachment.

countOfInitialPages Integer The default value is 0, which will cause PCCIS to behave in its default manner converting all pages (running enterprise=3) of the document as soon as any page is requested. Setting countOfInitialPages to a value greater than 0, will instruct PCCIS to use two separate enterprise=3 operations: one to convert pages 0 through n-1 (where "n" the supplied value) and a second conversion to process pages "n" through the end of the document. The second conversion will only occur when content that has not been converted is requested. This should allow the first "n" pages to be created and delivered to the client without forcing the entire document to be converted.
documentSource String

Instructs PCCIS to download the content from the HTTP(s) location defined by the externalId parameter in a background thread. PCCIS will accept the values "http", "api" or null/empty (same as "api"). Any other value will throw an exception and return 500 status from POST (details will be written to the log).

Using this parameter will eliminate the need to issue the PUT ViewingSession/u
{ViewingSessionID}/SourceFile request and the POST ViewingSession/u{ViewingSessionID}
/Notification/SessionStarted. PCCIS will download the content and process as soon as content is available.

documentExtension String Defines the extension of the document defined in the externalId. The preceding "." should NOT be included, otherwise an exception will be thrown and return 500 status from POST (details in the log).
startConverting String

This property determines when the process to generate pages for viewing is started. This property requires that documentSource is "http" and contentType is set to a valid value. Valid values are:

  • "initialPages" means the process to generate pages for viewing is started during the initial POST /ViewingSession request.
  • "none" means the process to generate pages for viewing is started later during a request to POST /ViewingSession/{id}/Notification/SessionStarted, GET /Page or GET /PageAttributes, whichever comes first.
contentType String

This property sets the type of pages that are generated for viewing if startConverting is not "none". Valid values are:

  • "png" means that PNG pages will be generated for viewing.
  • "svg" means SVG pages will be generated for viewing.
  • "swf" means SWF pages will be generated for viewing.

Response Body

If successful, this method returns the following properties:

Property Name

Value

Description

viewingSessionId

String

The ID for this new viewing session.

Example
Copy Code
POST http://localhost:18681/PCCIS/V1/ViewingSession
Example Response
Copy Code
{"viewingSessionId":"8091681f-15bf-4150-94a0-3ff7f2acd42d"}

PUT ViewingSession/u{ViewingSessionID}/SourceFile?FileExtension={FileExtension}

A document source is uploaded to the PCCIS services by writing the contents into the request stream using the viewing session ID from the previous viewing session ID request. 

Http Method

PUT

Resource URL

http://localhost:18681/PCCIS/V1/ViewingSession/u{ViewingSessionID}/SourceFile?FileExtension={FileExtension}

Parameters

ViewingSessionID The ID of the viewing session associated with the request.
FileExtension

The extension representing the type of document being uploaded. This value should not include a '.' character prefix. 

Request Body

In the request body, supply the document data to be uploaded.

Response Body

Empty.

Example
Copy Code
PUT //localhost:18681/PCCIS/V1/ViewingSession/
u8091681f-15bf-4150-94a0-3ff7f2acd42d/SourceFile?FileExtension=doc
Example Response
Copy Code
Empty

POST ViewingSession/u{ViewingSessionID}/Notification/SessionStarted

This RESTful API requests the PCCIS service to begin conversion of the document to either HTML or Flash format. The body posted to the service will have an object which indicates the preference. The object property, viewer, will either be set to "HTML5" or "Flash". 

Http Method

POST

Resource URL

http://localhost:18681/PCCIS/V1/ViewingSession/u{ViewingSessionID}/Notification/SessionStarted

Parameters

ViewingSessionID

The ID of the viewing session associated with the request.

Request Body

In the request body, supply an object with the following required property:

Property Name Value Description
viewer String

Specify the type of viewer being used. The supported values are:

  • "HTML5"
  • "Flash"

Response Body

Empty.

Example
Copy Code
POST http://localhost:18681/PCCIS/V1/ViewingSession/
u8091681f-15bf-4150-94a0-3ff7f2acd42d/Notification/SessionStarted.
Example Response
Copy Code
Empty

POST ViewingSession/u{ViewingSessionID}/Notification/SessionStopped

If the upload session fails (typically an exception is thrown), this RESTful API must be called to notify the PCCIS services that the upload cannot be completed and stop everything concerning the viewing session Id indicated. An error status and message is noted in the object posted. 

Http Method

POST

Resource URL

http://localhost:18681/PCCIS/V1/ViewingSession/u{ViewingSessionID}/Notification/SessionStopped

Parameters

ViewingSessionID The ID of the viewing session associated with the request.

Request Body

Empty.

Response Body

Empty.

Example
Copy Code
POST http://localhost:18681/PCCIS/V1/ViewingSession/
u8091681f-15bf-4150-94a0-3ff7f2acd42d/Notification/SessionStopped
Example Response
Copy Code
Empty

 

Attachments

Viewing EML and MSG attachments using PCCIS.

GET ViewingSession/u{ViewingSessionID}/Attachments

This RESTful API returns a JSON List object Attachments containing the collection of Attachment objects. If the return object list length has a zero count and no errors detected, there are no attachments. The status property of the List object denotes whether the list is completed or not thus whether the request must be retried again. Each Attachment object in the list contains displayName and viewingSessionId property. The displayName can be used to label a href link on a web page and the link points to the viewingSessionId URL for the attachment. Please see the PCCIS samples for more details. 

Http Method

GET

Resource URL

http://localhost:18681/PCCIS/V1/ViewingSession/u{ViewingSessionID}/Attachments

Parameters 

ViewingSessionID The ID of the viewing session associated with the request.

Request Body

Empty.

Response Body

If successful, this method returns the following properties:

Property Name

Value

Description

status

String

Specifies the current status of the attachments.

  • "pending" means that there may be attachments, but the list has not yet been constructed.
  • "complete" means that the list is known and present in this object.

attachments

List

The list of attachments, if any. Each item in this list will be a new viewing session ID, which is used to view any of the listed attachments in the viewer by passing in the viewing session ID provided in this list.

Example
Copy Code
GET http://localhost:18681/PCCIS/V1/ViewingSession/
u8091681f-15bf-4150-94a0-3ff7f2acd42d/Notification/SessionStopped
Example Response
Copy Code
Empty.

Service Information

PCCIS Monitoring and Error Reporting.

GET Service/Current/Info

This API returns a JSON PccisInfo object indicating the health of PCCIS services.

Http Method

GET

Resource URL

http://localhost:18681/PCCIS/V1/Service/Current/Info

Parameters 

None

Request Body

None

Response Body

If successful, this method returns the following properties:

Property Name

Value

Description

serviceStatus

String

Status of PCCIS.

  • "running"
  • "unhealthy"
  • "error"
  • "unavailable"
  • "unknown"

licenseStatus

String

Information about the PCC license.

  • "not licensed"
  • "licensed as ‘…’"

instances

list

Information about individual instances of PCCIS. In the current version, only one instance will be returned.

Example
Copy Code
GET http://localhost:18681/PCCIS/V1/Service/Current/Info
Example Response
Copy Code
{"serviceStatus":"running","licenseStatus":"licensed as ...","instances":
[{"serviceStatus":"running","pccisVersion":"8.0.0.0","runtimeVersion":"4.0.30319.18034",
"operatingSystem":"Microsoft Windows NT 6.1.7601 Service Pack 1","startTime":"2013-08-
14T14:10:51.1636185Z","instanceId":"USER-PC","childServices":[{"name":"PCC Imaging Proxy
Server","serviceStatus":"running","version":"8.0.1000.0000"}]}]}

GET Service/Current/Tasks

This API returns a JSON list of current tasks.   

Http Method

GET

Resource URL

http://localhost:18681/PCCIS/V1/Service/Current/Tasks

Parameters

None

Request Body

Empty.

Response Body

If successful, this method returns a list of objects with the following properties:

Property Name

Value

Description

id

String

The numeric ID of this task.

name

String

Information about the PCC license.

  • "not licensed"
  • "licensed as ‘…’"

parameters

String

The parameters that were passed to the public API.

duration

Double

The time it took to run the task.

Example
Copy Code
GET http://localhost:18681/PCCIS/V1/Service/Current/Tasks
Example Response
Copy Code
[{"id":"1340","name":"GET Service Current Tasks",
"parameters":"None","duration":0}]

GET Service/History/Tasks

This API returns a JSON list of previous tasks and information on when they ran and the duration of the task. The information returned will span the last two minutes.

Http Method

GET

Resource URL

http://localhost:18681/PCCIS/V1/Service/History/Tasks

Parameters

None 

Request Body

Empty. 

Response Body

If successful, this method returns a list of object with the following properties:

Property Name

Value

Description

id

String

The numeric ID of this task.

name

String

The name of the task. This will match, to some extent, the public API.

parameters

String

The parameters that were passed to the public API.

startTime

String

The UTC time when the task started, formatted as a string using ISO 8601. JSON does not have a formal date type so dates are represented as ISO 8601 strings.

duration

Double

The time it took to run the task.

 

Example
Copy Code
GET http://localhost:18681/PCCIS/V1/Service/History/Tasks
Example Response
Copy Code
[{"id":"2731","name":"GET Service History Tasks","parameters":"None",
"startTime":"2013-08-14T14:23:49.5164460Z","duration":0.0080007999999999989},
{"id":"2732","name":"GET Service History Errors","parameters":"None","startTime":"2013-08-
14T14:23:49.8044748Z","duration":0}]

GET Service/History/Errors

This API returns a JSON list of HistoricalLogItem for the last 15 minute time period.

Http Method

GET

Resource URL

http://localhost:18681/PCCIS/V1/Service/History/Errors

Parameters

None 

Request Body

Empty. 

Response Body

If successful, this method returns a list of objects with the following properties:

Property Name

Value

Description

time

String

The UTC time when the event, formatted as a string using ISO 8601. JSON does not have a formal date type so dates are represented as ISO 8601 strings.

level

String

The NLog level of the item. This may be:

  • "Error"
  • "Fatal"

message

String

The message associated with the event.

exception

String

Details of the exception that was thrown to cause this item to be logged. It is possible, but unlikely that this value will be NULL.

 

Example
Copy Code
GET http://localhost:18681/PCCIS/V1/Service/History/Errors
Example Response
Copy Code
[{"time":"2013-08-14T14:40:57.8242665Z","level":"Error","message":
"End: Unable to process request","exception":"WebException:
Unable to connect to the remote server"},{"time":"2013-08-
14T14:41:11.6906530Z","level":"Error","message":
"Enterprise 3 document text watcher task failed","exception":
"DirectoryNotFoundException: Could not find a part of the path
\u0027C:\\ProgramData\\Accusoft\\Prizm\\Cache\\
dfebd89e-6cde-43b3-a535-3a52accfe311\\25c79ba3-95dd-4907-94d1-
ed3f91c8a3ec\\ol1_rr150_Intermediate.xml\u0027."}]

GET Service/History/ViewingSessions

The API returns a JSON list of class HistoricalViewingSession objects for the last 30 hours.

Http Method

GET

Resource URL

http://localhost:18681/PCCIS/V1/Service/History/ViewingSessions

Parameters

None 

Request Body

Empty. 

Response Body

If successful, this method returns a list of objects with the following properties:

Property Name

Value

Description

startTime

String

The UTC time when the event, formatted as a string using ISO 8601. JSON does not have a formal date type so dates are represented as ISO 8601 strings.

externalId

String

External reference ID string. Helpful for log tracing.

viewingSessionId

String

The document ID.

 

Example
Copy Code
GET http://localhost:18681/PCCIS/V1/Service/History/ViewingSessions
Example Response
Copy Code
[{"startTime":"2013-08-14T14:13:25.6740680Z","externalId":
"F7-92-5C-CE-28-BE-AD-6F-79-C3-FE-FF-87-FE-FA-B6-73-7F-F5-92",
"viewingSessionId":"7045a365-9f59-45eb-a1cf-7e213b5a6223"},
{"startTime":"2013-08-14T14:13:25.6740680Z","externalId":
"F7-92-5C-CE-28-BE-AD-6F-79-C3-FE-FF-87-FE-FA-B6-73-7F-F5-92",
"viewingSessionId":"0f0f0854-3019-4028-a576-27977dc01855"},
{"startTime":"2013-08-14T14:24:35.3830322Z","externalId":
"F7-92-5C-CE-28-BE-AD-6F-79-C3-FE-FF-87-FE-FA-B6-73-7F-F5-92",
"viewingSessionId":"bb2d91c7-4cf7-477b-a726-67349ee05a92}]

All Viewing

License information.

GET License/ClientViewer

There is a license URL which the client JavaScript viewer control (pccViewer) must use to enable viewing. The information sent by the control must be present in the Web Tier. The query parameters sent to this URL must be passed onto PCCIS. Information is returned back to the client control to enable viewing. If this communication sequence is not done or fails in any matter, no document views will be possible.

Http Method

GET

Resource URL

http://localhost:18681/PCCIS/V1/License/ClientViewer

Parameters

v License value 1.

iv

License value 2.

p

License value 3.

Request Body

Empty. 

Response Body

If successful, this method returns a string used by the viewer for licensing.

Example
Copy Code
GET http://localhost:18681/PCCIS/V1/License/ClientViewer

Example Response
Copy Code
K98u234982340/xdfwe/
Zsdfaslkj90394lke93asljfjsjf+
asfjoPopoijojiALKidije93lkj0Y
4aAq6FvBW7nqCSDFdeflk3j3j=

HTML5 Viewing

HTML5 viewing information.

GET Page/q/{PageNumber}/Attributes?DocumentID=[e,u]{ViewingSessionId}

This API requests or reads the information about a particular document page. The return information is a JSON string. The form has a query parameter, DocumentID, which can have for its value an un-encoded “u” prefix followed by the viewing session ID or a base 64 encoded viewing session ID prefixed with “e”. The {PageNumber} parameter always begins with zero (0) for the first page within a document.

Http Method

GET

Resource URL

http://localhost:18681/PCCIS/V1/Page/q/{pageNumber}/Attributes?DocumentID=[e,u]{ViewingSessionId}

Parameters

PageNumber

The page number of the document being requested. The first page within a document is always 0.

DocumentID

The Viewing Session ID.

Request Body

Empty.

Response Body

If successful, this method returns an object with the following properties:

Property Name

Value

Description

version

String

The version of the viewer to consume this request.

contentType

String

The type of content that is available for this document.

imageBitDepth

Integer

The bit depth of the viewable content.

imageHeight

Integer

The height of the viewable content.

imageXResolution

Integer

The X resolution of the viewable content.

imageYResolution

Integer

The Y resolution of the viewable content.

Example
Copy Code
GET http://localhost:18681/PCCIS/V1/Page/q/0/Attributes?DocumentID=eOQA...
Example Response
Copy Code
{"version":"7.1","contentType":"jpeg,png,svg","imageBitDepth":16,
"imageHeight":990,"imageWidth":765,"imageXResolution":0,"imageYResolution":0}

GET Page/q/{PageNumber}?DocumentID=[e,u]{ViewingSessionId}&Scale={ScaleValue}&ContentType=[jpeg, png, svg]

This RESTful API returns a full page image. The Scale and ContentType query parameters affect the image with respect to the parameters intent. The ContentType parameter may have the following parameter value for now: JPEG,PNG or SVG. If SVG is chosen, the scale values are ignored as a SVG (vectored) stream is returned for which this parameter have no practical meaning. The scale query parameter with a value 1.0 gives a non-resized image. Less than 1.0 values shrink the image and larger than 1.0 values increase the image size.

Http Method

GET

Resource URL

http://localhost:18681/PCCIS/V1/Page/q/{PageNumber}?DocumentID=[e,u]{ViewingSessionId}&Scale={ScaleValue}&ContentType=[jpeg, png, svg]

Parameters

PageNumber

The page number of the document being requested. The first page within a document is always 0.

DocumentID

The Viewing Session ID.

ScaleValue

The intended scale value of the page image. This is ignored for SVG streams.

ContentType

The intended content type of the page image.

Request Body

Empty.

Response Body

If successful, this method returns the requested page content.

Example
Copy Code
GET http://localhost:18681/PCCIS/V1/Page/q/0?DocumentID=eOQA5...
&Scale=1&ContentType=svg

 

Example Response
Copy Code
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns=http://www.w3.org/2000/svg
xmlns:cc="http://creativecommons.org/ns#" ...</svg>

GET Page/q/{PageNumber}/Tile/{x}/{y}/{width}/{height}?DocumentID=[e,u]{ViewingSessionId}&Scale={Scale Value}&ContentType=png

This request returns a tile of the requested document page. The tile is formed from the pixel coordinate specified by the x and y parameters and the width and height parameters. This tile is resized as determined by the scale factor. The contentType should only be PNG for tiles as JPEG can cause artifact issues in alignment. Requesting SVG content will cause an error response as this content type is vector data and does need to be tiles like raster images. The scale query parameter with a value 1.0 gives a non-resized image. Less than 1.0 values shrink the tile and larger than 1.0 values increase the tile size.

Http Method

GET

Resource URL

http://localhost:18681/Page/q/{pageNumber}/Tile/{x}/{y}/{width}/{height}?DocumentID=[e,u]{ViewingSessionId}&Scale={Scale Value}&ContentType=png

Parameters

PageNumber

The page number of the document being requested. The first page within a document is always 0.

DocumentID

The Viewing Session ID.

Scale

The intended scale value of the page image. This is ignored for SVG streams.

ContentType

The intended content type of the page image.

x

The x coordinate of the requested tile relative to the original image.

y

The y coordinate of the requested tile relative to the original image.

width

The width of the requested tile.

height

The height of the requested tile.

Request Body

Empty.

Response Body

If successful, this method provides the requested page tile content.

Example
Copy Code
GET http://localhost:18681/PCCIS/V1/Page/q/0/
Tile/0/0/1275/1024?DocumentID=eOAA5...
&Scale=1&Quality=100&ContentType=png

 

Example Response
Copy Code
Empty

GET Page/q/{PageNumber}/{Width}x{Height}?DocumentID=[e,u]{ViewingSessionId}&ContentType=[jpeg,png]

This request returns a thumbnail of the requested document page. The thumbnail size is constrained within the width and height pixel parameters and the aspect ratio of the image is maintained. The contentType can only be PNG or JPEG.

Http Method

GET

Resource URL

http://localhost:18681/Page/q/{pageNumber}/{width}x{height}?DocumentID=[e,u]{ViewingSessionId}&ContentType=[jpeg, png]

Parameters

PageNumber

The page number of the document being requested. The first page within a document is always 0.

DocumentID

The Viewing Session ID.

ContentType

The intended content type of the thumbnail page image.

width

The maximum width of the requested thumbnail.

height

The maximum height of the height of the requested thumbnail.

Request Body

Empty.

Response Body

If successful, this method provides the requested page thumbnail content.

Example Title
Copy Code
GET http://localhost:18681/PCCIS/V1/Page/q/0/
200x300?DocumentID=eOAA5...
&ContentType=png
Example
Copy Code
Empty

GET Document/q/Attributes?DocumentID=[e,u]{ViewingSessionId}&DesiredPageCountConfidence={PercentageValue}

This request returns a JSON string giving the page count of the document requested and the confidence value. Because page rendering may be different than what a file format may indicate for number of pages, there is a need for a confidence value indicating how confident the page count acquired will be prior to having all the pages generated. The DesiredPageCountConfidence parameter indicates what the minimum level required to be returned thus implying how long the request may take to return a precise value. The DesiredPageCountConfidence is segmented in this release where 50 percent or below may get an estimate page count value and above 50 percent will try to get a more accurate count. If a pageCountConfidence value of less than 100 percent is returned, it means that the request is still being worked on and to try again if an accurate count is still desired.

Http Method

GET

Resource URL

Parameters

DocumentID

The Viewing Session ID.

DesiredPageCountConfidence

The intended percentage of confidence to use in determining the page count.

Request Body

Empty.

Response Body

If successful, this method returns an object with the following properties:

Property Name

Value

Description

pageCount

Integer

The determined number of pages in the document.

pageCountConfidence

Integer

If value is less than 100 it means that the page count is still being determined, and to try again if a more accurate count is needed.

Example
Copy Code
GET http://localhost:18681/PCCIS/V1/
Document/q/Attributes?DocumentID=eOQA5...
&DesiredPageCountConfidence=50

 

Example Response
Copy Code
{"pageCount":3,"pageCountConfidence":100}

GET Document/q/{PageNumberBegin}-{PageNumberEnd}/Text?DocumentID=[e,u]{ViewingSessionId}

This request returns a JSON string containing the text extracted from the given document. The {PageNumberBegin} denotes the first page and {PageNumberEnd} denotes the last page to be included the extracted text. The lowest value for {PageNumberBegin} parameter is zero (0) – that indicates the first page within the document.

Http Method

GET

Resource URL

http://localhost:18681/PCCIS/V1/ Document/q/0-2/Text?DocumentID=eMAA2...

Parameters

DocumentID

The Viewing Session ID.

PageNumberBegin

The page to begin extracting text from.

PageNumberEnd

The page to end extracting text from.

Request Body

Empty.

Response Body

If successful, this method returns an object with the following properties:

Property Name

Value

Description

pages

List

A list of Nested Objects describing the extracted text for each of the pages in range.

pages.number

Integer

Denotes the number the current page to which the extracted text.belongs.

pages.text

String

Extracted text of the current page.

Example
Copy Code
GET http://localhost:18681/PCCIS/V1/Document/q/0-2/Text?DocumentID=eMAA2...
Example Response
Copy Code
{"pages":[{"number":0,"text":"Congratulations You have successfully installed
Prizm Content Connect  www accusoft com  Page 1 of Document"},{"number":1,
"text":"Page 2 of Document"},{"number":2,"text":"Page 3 of Document"}]}

Flash Viewing

Flash conversion to SWF.

GET FlashViewer/Convert?fileName={EncodedVewingSessionId}&pageNumber={pageNumber}

Requests a document page in SWF format. The return object is a SWF object. Please note that flash API methods assumes a unique base64 encoding of the session Id. Please see the PCCIS flash sample use of CommonCode.Encoder.EncodeURLString(vewingSessionId).

Http Method

GET

Resource URL

http://localhost:18681/PCCIS/V1/FlashViewer/Convert?fileName={EncodedViewingSessionId}&pageNumber={pageNumber}

Parameters

fileName

The Viewing Session ID.encoded in a specific base64 format.

pageNumber

The page number for which SWF content will be returned.

fidelity

The fidelity to use for SWF conversion.

  • "low" = No compression for text and images.
  • "medium" = Text is preserved while everything else is converted to JPEG compressed images.
  • "high" = All content is converted into a single SWF, only links are preserved.

Request Body

Empty.

Response Body

If successful, this method returns the request SWF content.

Example
Copy Code
GET http://localhost:18681/PCCIS/V1/Convert?documentname=OABlA...
&fileName=OABlA...&instanceid=8ADD1...
&pageNumber=1&fidelity=low

 

Example Response
Copy Code
Empty

GET FlashViewer/GetActualPageCount?fileName={EncodedViewingSessionId}

Gets the actual page count.

The actual page count API returns a pages=<page count> in the response. The actual page count is the definitive page count but may be slow to retrieve. Depending on whether the application is using the PCCIS service or not, the filename will need an encoded session Id or just the document file name. If PCCIS services is being used, encode the viewing session Id with CommonCode.Encoder.EncodeURLString(vewingSessionId).

Http Method

GET

Resource URL

http://localhost:18681/PCCIS/V1/FlashViewer/GetActualPageCount?documentname={EncodedViewingSessionId}&fileName={EncodedViewingSessionId}&instanceid={InstanceId}

Parameters

documentname

The Viewing Session ID.encoded in a specific base64 format.

fileName

The Viewing Session ID.encoded in a specific base64 format.

instanceId

An instance ID defined by the Flash viewer.

Request Body

Empty.

Response Body

If successful, this method returns the following properties:

Property Name

Value

Description

pages

Integer

The actual number of pages in the document.

Example
Copy Code
GET http://localhost:18681/PCCIS/V1/FlashViewer/
GetActualPageCount?documentname=OABlA...
&fileName=OABlA...&instanceid=8ADD1...
Example Response
Copy Code
pages=3

GET GetEstimatedPageCount

Gets an estimated page count.

The estimated page count API returns a pages=<page count> in the response. The estimated page request is relatively fast but not necessarily accurate. Depending on whether the application is using the PCCIS service or not, the filename will need an encoded session Id or just the document file name. If PCCIS services is being used, encode the viewing session Id with CommonCode.Encoder.EncodeURLString(vewingSessionId).

Http Method

GET

Resource URL

http://localhost:18681/PCCIS/V1/FlashViewer/GetEstimatedPageCount?documentname={EncodedViewingSessionId}&fileName={EncodedViewingSessionId}&instanceid={InstanceId}

Parameters

documentname

The Viewing Session ID.encoded in a specific base64 format.

fileName

The Viewing Session ID.encoded in a specific base64 format.

instanceId

An instance ID defined by the Flash viewer.

Request Body

Empty.

Response Body

If successful, this method returns the following properties:

Property Name

Value

Description

pages

Integer

The estimated number of pages in the document.

Example
Copy Code
GET http://localhost:18681/PCCIS/V1/FlashViewer/
GetEstimatedPageCount?documentname=OABlA...&fileName=OABlA...
&instanceid=8ADD1...
Example Response
Copy Code
pages=3

 

 


©2013. Accusoft Corporation. All Rights Reserved.

Send Feedback